package cn.zhentao.controller;

import cn.zhentao.pojo.Logistics;
import cn.zhentao.pojo.Maintenance;
import cn.zhentao.service.AfterSalesService;
import cn.zhentao.vo.MaintenanceVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@RequestMapping("AfterSales")
@RestController
public class AfterSalesController {
    @Autowired
    private AfterSalesService afterSalesService;
    @GetMapping("findlogisticsAll")
    public List<Logistics> findlogisticsAll(){
        return afterSalesService.findlogisticsAll();
    };
    @PostMapping("insertmaintenance")
    public int insertmaintenance(@RequestBody Maintenance maintenance){
        return afterSalesService.insertmaintenance(maintenance);
    }
    @PutMapping("updateOrderState")
    public int updateOrderState(int maintenanceOrder){
        return afterSalesService.updateOrderState(maintenanceOrder);
    }
    @GetMapping("findAllMaintenanceVo")
    public List<MaintenanceVo> findAllMaintenanceVo(int uid) {
        return afterSalesService.findAllMaintenanceVo(uid);
    }
}
